﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TSP
{
    class StateComparer : IComparer<State>
    {

        public int Compare(State x, State y)
        {
            if (x.Level == y.Level)
            {
                return x.GetCost().CompareTo(y.GetCost());
            }
            else
            {
                return -x.Level.CompareTo(y.Level);
            }
        }
    }

	class MatrixComp : IComparer<CostMatrix>
	{
		public int Compare(CostMatrix a, CostMatrix b)
		{
			if (a.costSoFar == b.costSoFar)
			{
				return a.costSoFar.CompareTo(b.costSoFar);
			}
			else
			{
				return -a.costSoFar.CompareTo(b.costSoFar);
			}
		}
	}

}